package com.my.kq.controller;

import com.my.kq.entity.AttendanceManagement;
import com.my.kq.service.AttendanceManagementService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@WebServlet("/kaoQinGuanLiServlet")
public class AttendanceManagementServlet extends HttpServlet {
//    考勤管理
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        try {
            AttendanceManagementService service = new AttendanceManagementService();
            List<AttendanceManagement> list = service.serlectList();
            req.setAttribute("list",list);
            req.getRequestDispatcher("jsp/admin/attendance_list.jsp").forward(req,resp);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doGet(req, resp);
    }
}
